/*
 * Copyright (c) 2018. J4dream Created.
 */

package com.j4dream.property.dao;

import com.j4dream.property.model.GeneratorDto;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface GeneratorDao {
    @Select("SELECT * FROM generator")
    List<GeneratorDto> getGeneratorList();

    @Insert({
            "INSERT INTO generator (id, owner, title, status, percent,  description, startTime, endTime) ",
            "VALUES (#{id}, #{owner}, #{title}, #{status}, #{percent}, #{description}, #{startTime}, #{endTime})"
    })
    void insertGenerator(GeneratorDto generatorDto);

    @Select("SELECT * FROM generator")
    GeneratorDto getGeneratorDetail();
}
